<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/js/jquery-3.0.0.min.js}">
    <link rel="stylesheet" th:href="@{/layer/layer.js}">
    <link rel="stylesheet" th:href="@{/layui/layui.all.js}">
    <link rel="stylesheet" th:href="@{/layui/layui.js}">
</head>
<body class="layui-layout-body" style="background-color: #AADFFD">
<div class="layui-layout layui-layout-admin" style="margin:auto;width:80%;height: 100%;background: white;" >
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;margin-right: 200px; background-color: #f9f9f9;">
            <div style="padding: 20px;">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6" style="width: 100%">
                        <div class="layui-card">
                            <div style="position: relative;left: 50%;width: 300px;margin-left: -100px" th:text="${chapterContent.chaptername}"></div>
                           <pre><textarea style="height: 100%;width: 100%;border: 0px"  th:text="${chapterContent.content}"/></pre>
                        </div>
<!--                        <div class="layui-card">-->
<!--                        </div>-->
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="/static/layui/layui.all.js"></script>
<script src="@{static/js/jquery-3.0.0.min.js}" rel="stylesheet"></script>
<script src="/static/layer/layer.js"></script>
<script type="text/javascript">

</script>
<script>
    layui.use('element', function(){
        var element = layui.element;
    });

</script>

</body>
</html>
<script>
    function readyNumber() {

        $("textarea").each(function () {
            this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
        }).on('input', function () {
            this.style.height = 'auto';
            this.style.height = (this.scrollHeight) + 'px';
        })
    }

    readyNumber();

</script>